﻿@{
    ViewBag.Title = "Task";
}

<!--头部-->
<div id="Header" class="ajaxLoadDiv">
    @{Html.RenderAction("Top");}
</div>
<div class="g-wrap">
    <!--左边-->
    <div id="Left" class="ajaxLoadDiv" name="leftnav01">
        @{ Html.RenderPartial("Left");}
    </div>

    <div class="g-main">
        <div class="layout_content_main h_100p" style="margin-right: 10px;">
            <!--面包屑start-->
            <div class="mod_navbar f-clear">
                <!--标题start-->
                <div class="title">
                    <h3><i class="icon-desktop mr_10" style="color: rgb(56, 168, 170);"></i>任务</h3>
                </div>
                <!--标题end-->
                <div class="main">
                    <div class="toolbar_panel f-right">
                        <div class="btn-group mr_15">
                            <button class="btn btn-danger addtaskbtn">新建任务 </button>
                        </div>

                    </div>
                </div>
            </div>
            <!--面包屑end-->
            <div class="entries_panel js-sortable layout_content_main_nonav">
                <div class="entries_panel_sortarea ui-sortable">
                    <!--要做start-->
                    <div class="entry ng-scope">
                        <div class="entry_header">
                            <div class="entry_header_title js-editable">
                                <h2 class="ng-binding">要做 <i></i> </h2>
                            </div>
                            <a href="javascript:;" class="js-popbox entry_header_menu ng-scope"> <i class="icon-play-circle"></i> </a>
                        </div>
                        <div class="entry-task-panel" >
                            <div class="entry-tasks js-sortable ui-sortable" id="list0">

                            </div>
                        </div>
                        <div class="entry-task-footer ng-scope"> <a href="javascript:;" class="js-add-task-composer">新建任务</a> </div>
                    </div>
                    <!--要做end-->
                    <!--在做start-->
                    <div class="entry ng-scope">
                        <div class="entry_header">
                            <div class="entry_header_title js-editable">
                                <h2 class="ng-binding">在做 <i></i> </h2>
                            </div>
                            <a href="javascript:;" class="js-popbox entry_header_menu ng-scope"> <i class="icon-play-circle"></i> </a>
                        </div>
                        <div class="entry-task-panel" >
                            <div class="entry-tasks js-sortable ui-sortable" id="list1">

                            </div>
                        </div>
                        <div class="entry-task-footer ng-scope"> <a href="javascript:;" class="js-add-task-composer">新建任务</a> </div>
                    </div>
                    <!--在做end-->
                    <!--待定start-->
                    <div class="entry ng-scope">
                        <div class="entry_header">
                            <div class="entry_header_title js-editable">
                                <h2 class="ng-binding">待定 <i></i> </h2>
                            </div>
                            <a href="javascript:;" class="js-popbox entry_header_menu ng-scope"> <i class="icon-play-circle"></i> </a>
                        </div>
                        <div class="entry-task-panel">
                            <div class="entry-tasks js-sortable ui-sortable" id="list2">

                            </div>
                        </div>
                        <div class="entry-task-footer ng-scope"> <a href="javascript:;" class="js-add-task-composer">新建任务</a> </div>
                    </div>
                    <!--待定end-->
                </div>
            </div>
        </div>

    </div>
</div>

<!--新建任务弹出层-->
<div class="popbox addnewtask" style="display: none; left: auto; right:25px; top: 115px;">
    <div class="popbox-header">
        <button class="cancel icon-remove"></button>
        <h3>新建任务</h3>
    </div>
    <form name="add_task_form" class="wt-form ng-pristine ng-invalid ng-invalid-required">
        <div class="popbox-body w_300">
            <div class="form-group">
                <div>
                    <textarea id="txtTitle1" class="js-task-name form-control ng-pristine ng-invalid ng-invalid-required" placeholder="输入任务内容" style=""></textarea>
                </div>
            </div>
            <div class="form-group" ng-show="entries.length > 0">
                <label>列表：</label>
                <select id="sloption" class="form-control ng-pristine ng-animate ng-invalid-remove ng-valid-add ng-invalid-required-remove ng-valid-add-active ng-invalid-remove-active ng-valid ng-invalid-required-remove-active ng-valid-required" style="">
                    <option value="0" selected="selected">要做</option>
                    <option value="1">在做</option>
                    <option value="2">待定</option>
                </select>
            </div>
        </div>
        <div class="popbox-footer">
            <button type="button" class="btn btn-success mr_15" id="btnSave1">保存 </button>
            <button type="button" class="btn cancel btn-success mr_15">取消</button>
        </div>
    </form>
</div>

<!--任务右侧弹出层-->
<div class="slide-content" style="overflow: hidden; right: 0px; top: 60px; width: 700px; display: none;">
    <div class="entity-panel task-panel">
        <div class="entity-panel-wrapper">
            <!--弹出层头-->
            <div class="entity-panel-header">

                <ul class="nav nav-pills">
                    @*<li class="ng-scope"> <a href="javascript:;" title="截止日期"> <i class="icon-time"></i>日期 </a> </li>
                        <li class="ng-scope"> <a href="javascript:;" title="添加检查项"> <i class="icon-th-list"></i>检查项 </a> </li>
                        <li class="divider-v ng-scope"></li>
                        <li class="js-popbox ng-scope"> <a href="javascript:;" class="dropdown-toggle" title="添加附件"> <i class="icon-paper-clip"></i>附件 </a></li>
                        <li class="js-popbox"> <a href="javascript:;" class="dropdown-toggle" title="更多"> <i class="icon-chevron-down"></i>更多 </a></li>*@
                    <li class="divider-v"></li>
                    <li> <a href="javascript:;" title="关闭"> <i class="icon-remove"></i> </a> </li>
                </ul>
            </div>
            <!--弹出层内容-->
            <div class="entity-panel-body height-nonav" style="overflow: hidden; height: 786px;">
                <!--左侧内容-->
                <div class="content-panel" taskid="">
                    <div class="content-module editable-module">
                        <!--名称-->
                        <div class="taskname">
                            <div class="entity-title">
                                <a class="task_check"> <i class="icon-check-empty"></i> </a>
                                <h2 class="ng-binding">
                                    <span class="ng-binding" id="spTitle"></span>
                                    <em class="ng-binding" id="spKind"></em>
                                </h2>
                            </div>
                            <div class="task-badges" task="task"></div>
                            <div class="task-desc-add ng-hide">
                                <a href="javascript:;" id="aTips">点击添加任务描述</a>
                            </div>
                            <div class="task-desc">
                                <div class="task-desc-text markdown ng-binding" id="divDesc">

                                </div>
                            </div>
                        </div>
                        <!--编辑-->
                        <div class="f-hide taskedit">
                            <div class="edit-section">
                                <input type="text" placeholder="任务名称" class="form-control" id="txtTaskTitle" />
                                <textarea type="text" placeholder="添加任务描述" class="form-control gollum-editor-body" id="txtTaskDesc"></textarea>
                            </div>
                            <div class="form-group">
                                <button type="button" class="btn btn-success mr_15" id="btnSave2">保存 </button>
                                <button type="button" class="btn btn-success mr_15" id="btnCancelTitle">取消</button>
                            </div>
                        </div>
                        <!--评论活动-->
                        <div class="tabbable">
                            <ul class="tabs nav-tabs f-clear commenttab">
                                <li class="active"> <a>评论</a> </li>
                                <li class=""> <a>活动</a> </li>
                            </ul>
                            <div class="tab-content">
                                <!--评论-->
                                <div class="tab-pane active commentcon">
                                    <div class="comment-list">
                                        <div class="part-loading mt_20" style="display: none;"></div>
                                        <div class="new-comment">
                                            <a class="new-comment-avatar avatar avatar-40" size="40" title="梅郑冬" href="javascript:;"> <span class="avatar-face"><span class="avatar-text">梅</span></span> </a>
                                            <div class="new-comment-edit">
                                                <textarea placeholder="说点什么(按Ctrl + 回车键提交)" class="ng-pristine ng-valid"> </textarea>
                                                <div class="add-controls">
                                                    <ul class="nav nav-pills">
                                                        <li class="btn-group js-popbox dropup mr_5">
                                                            <a href="javascript:;" class="dropdown-toggle" title="添加附件"> <i class="icon-paper-clip"></i> </a>
                                                            <ul class="dropdown-menu">
                                                                <li>
                                                                    <a href="javascript:;" class="fileinput-button">
                                                                        <i class="icon-desktop"></i>本地上传
                                                                        <input type="file" title="添加附件">
                                                                    </a>
                                                                </li>
                                                                <li> <a href="javascript:;"> <i class="icon-file"></i> 从项目文件选择 </a> </li>
                                                            </ul>
                                                        </li>
                                                        <li class="divider-v"></li>
                                                        <li class="js-popbox mr_10"> <a href="javascript:;"> <i class="icon-smile"></i> </a> </li>
                                                        <li> <a class="js-popbox mr_10 font_at" href="javascript:;"></a> </li>
                                                    </ul>
                                                    <button class="btn btn-success pull-right ng-binding">发表评论 </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--活动-->
                                <div class="tab-pane commentcon f-hide">
                                    <div class="empty-panel">
                                        <i class="icon-time"></i><br>
                                        <span>还没有任何活动</span>
                                    </div>
                                    <div class="loading-more-panel">
                                        <div class="part-loading ng-hide"> </div>
                                        <button class="btn ng-hide"> 加载更多... </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--右侧内容-->
                <div class="sidebar-panel" style="min-height: 785px;">
                    <div class="sidebar-module">
                        <h4>标签</h4>
                        <div class="task-labels">
                            <button class="btn btn-block js-popbox ng-scope"><i class="icon-tag"></i>设置标签 </button>
                        </div>
                    </div>
                    <div class="sidebar-module">
                        <h4>分配</h4>
                        <div class="entity-members">
                            <ul>
                                <li class=""> <a class="avatar-add js-popbox" href="javascript:;" type="member" entity="task"> <span class="o"> <i class="icon-plus"></i> </span> </a> </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="/Content/Js/common.js"></script>
<script src="~/Scripts/Juicer/src/juicer.js"></script>
<script src="~/Scripts/rg-utility.js"></script>
<script src="~/Scripts/jquery.mCustomScrollbar.concat.min.js"></script>
@*<script src="~/Models/home/task.js"></script>*@
<script type="text/javascript">
    $(function () {
        //右侧切换
        $("#righttoggle").click(function () {
            if ($(this).find("i").hasClass("icon-step-forward")) {
                $(".layout_right_sidebar").css("width", "86px");
                $(".g-main .layout_content_main").css("margin-right", "86px");
                $(this).find("i").removeClass("icon-step-forward").addClass("icon-step-backward");
                $(".layout_right_sidebar").addClass("sidebar_collapse");
                $(".prj_sidebar_main").find("h4").addClass("f-hide");
                $(".addnewtask").css("right", "180px");
            }
            else {
                $(".layout_right_sidebar").css("width", "240px");
                $(".g-main .layout_content_main").css("margin-right", "240px");
                $(this).find("i").removeClass("icon-step-backward").addClass("icon-step-forward");
                $(".layout_right_sidebar").removeClass("sidebar_collapse");
                $(".prj_sidebar_main").find("h4").removeClass("f-hide");
                $(".addnewtask").css("right", "335px");
            }
        })

        /*右侧任务切换*/
        $(".prjtab li").click(function () {
            $(".prjtab li").removeClass("active");
            $(this).addClass("active");
            var ind = $(".prjtab li").index($(this));
            $(".prjtabcon").addClass("collapse_hide");
            $(".prjtabcon li").parents(".prj_sidebar").find(".prjtabcon").eq(ind).removeClass("collapse_hide");
        })

        /*评论活动切换*/
        $(".commenttab li").click(function () {
            $(".commenttab li").removeClass("active");
            $(this).addClass("active");
            var ind = $(".commenttab li").index($(this));
            $(".commentcon").removeClass("f-show").addClass("f-hide");
            $(".commenttab li").parents(".tabbable").find(".commentcon").eq(ind).removeClass("f-hide").addClass("f-show");
        })

        /*新建任务弹出层*/
        $(".addtaskbtn").click(function () {
            $(".addnewtask").show();
        })
        $(".cancel").click(function () {
            $(this).parents(".addnewtask").hide();
        })

        /*新建列表*/
        $(".entry-new").click(function () {
            $(this).removeClass("entry-add");
            $(this).find("a.entry-add").hide();
            $(this).find(".entrynewcon").removeClass("f-hide");
        })
        $(".entrycancle").click(function () {
            $(this).parents(".entry-new").addClass("entry-add");
            $(this).find("a.entry-add").show();
            $(this).parents(".entrynewcon").addClass("f-hide");
        })

        /*任务名称编辑*/
        $(".taskname").click(function () {
            $(this).addClass("f-hide");
            $(this).next(".taskedit").removeClass("f-hide").addClass("f-show");
        })

        /*点任务名时，弹出右侧内容*/
        $(".right_click_trigger").click(function () {
            $(".slide-content").show();
        })
        $(".icon-remove").click(function () {
            $(this).parents(".slide-content").hide();
        })

        $(".entry-task-panel").mCustomScrollbar({
            scrollButtons: {
                enable: false
            },
            advanced: {
                updateOnContentResize: true
            }
        })

        $(".layout_right_sidebar").mCustomScrollbar({
            scrollButtons: {
                enable: false
            },
            advanced: {
                updateOnContentResize: true
            }
        })

        var str = ' <div  class="right_click_trigger slide-trigger js-popbox task task_style task-first ui-droppable"><div class="entry-task-main" > <a class="entry-task-check"> <i class="icon-check-empty"></i> </a> <a class="entry-task-title ng-binding" href="javascript:;">点击这条任务，查看任务详情</a><div class="ng-scope"> <a href="javascript:;" class="js-popbox entry-task-menu ng-scope"> <i class="icon-play-circle"></i> </a></div></div><div class="task-badges"></div><div class="entry-task-members ng-hide"> </div></div> ';
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
        $('#list0').append(str);
    })
</script>